/*
*	Copyright (C) 2014  Julio Montes, Mario Carrillo
*
*	Julio Montes e-mail: imc.coder@gmail.com
*
*	Mario Carrillo e-mail: mario_90ago@live.com.mx
*
*	BSD 3-Clause License
*/

#include "include/iaMain.h"

#include "include/iaMainFrame.h"

#include "sdk/include/cfgmgr.h"
#include "sdk/include/lexermgr.h"
#include "sdk/include/pluginmgr.h"

IMPLEMENT_APP( iaMain )

iaMain::~iaMain()
{
}

int iaMain::OnExit()
{
    sdk::ConfigManager::Free();
    sdk::LexerManager::Free();
    sdk::PluginManager::Free();
    return 0;
}

bool iaMain::OnInit()
{
    wxImage::AddHandler( new wxPNGHandler );
    wxImage::AddHandler( new wxXPMHandler );

    iaMainFrame *mainFrame = new iaMainFrame;

    mainFrame->Maximize();
    mainFrame->Show();

    SetTopWindow( mainFrame );

    sdk::PluginManager::Get()->LoadPlugins();

    return true;
}
